package com.ww.seckill.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Administrator
 * @desc ww
 */
@Configuration
public class RabbitTopicMqConfig {

/*    *//**
     * TOPIC模式
     *//*
    private static final String TOPIC_QUEUE_01 = "topic_queue_01";
    private static final String TOPIC_QUEUE_02 = "topic_queue_02";
    private static final String TOPIC_EXCHANGE = "topicExchange";
    private static final String TOPIC_ROUTING_KEY_01 = "#.queue.#";
    private static final String TOPIC_ROUTING_KEY_02 = "*.queue.#";

    @Bean
    public Queue topicQueue01(){
        return new Queue(TOPIC_QUEUE_01);
    }
    @Bean
    public Queue topicQueue02(){
        return new Queue(TOPIC_QUEUE_02);
    }

    @Bean
    public TopicExchange topicExchange() {
        return new TopicExchange(TOPIC_EXCHANGE);
    }

    @Bean
    public Binding topicBinding01() {
        return BindingBuilder.bind(topicQueue01()).to(topicExchange()).with(TOPIC_ROUTING_KEY_01);
    }

    @Bean
    public Binding topicBinding02() {
        return BindingBuilder.bind(topicQueue02()).to(topicExchange()).with(TOPIC_ROUTING_KEY_02);
    }*/


}
